Conversation
|
/azp list |
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR fixes a race condition in the Send_TimeoutRequestContent_Throws test where the server connection could close before the client properly timed out, causing the test to fail intermittently with an HttpRequestException instead of the expected TaskCanceledException with TimeoutException inner exception.
Changes:
- Removed the
[ActiveIssue]attribute that was tracking the flaky test - Added semaphore-based synchronization between client and server to ensure the server stays alive until the client completes its assertions
| await server.AcceptConnectionAsync(async connection => | ||
| { | ||
| await IgnoreExceptions(connection.ReadRequestDataAsync()); | ||
| await semaphore.WaitAsync(); |
There was a problem hiding this comment.
The semaphore wait should include a timeout and assertion to prevent the test from hanging if the client-side assertions fail before releasing the semaphore. The established pattern in this test file is to use Assert.True(await semaphore.WaitAsync(5000), "semaphore timed out") to ensure the test fails fast with a clear message rather than hanging indefinitely. See lines 484, 647, and 717 for examples of this pattern.
| await semaphore.WaitAsync(); | |
| Assert.True(await semaphore.WaitAsync(5000), "semaphore timed out"); |
Fixes #39056